from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
import re
# Create your views here.
# from ronglian_sms_sdk import SmsSDK
#
# accId = '8aaf07087bc82708017bf7d07f680eca'
# accToken = '11114d28a2834df69fa330b15267ec4c'
# appId = '8aaf07087bc82708017bf7d0807d0ed1'
#
#
# def send_message():
#     sdk = SmsSDK(accId, accToken, appId)
#     tid = '1'
#     mobile = '15238155561'
#     datas = ('code', 'time')
#     resp = sdk.sendMessage(tid, mobile, datas)
#     print(resp)
class Register(APIView):
    def post(self,request):
        usernmae = request.data.get('username')
        if not all(usernmae):
            return Response({'code':10010})